<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-banner" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
        <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
      <h1><?php echo $heading_title; ?></h1>
      <ul class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
        <?php } ?>
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    <?php if ($error_warning) { ?>
    <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_edit; ?></h3>
      </div>
      <div class="panel-body">
        <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-banner" class="form-horizontal">
        <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-name"><?php echo $entry_name; ?></label>
            <div class="col-sm-10">
              <input type="text" name="name" value="<?php echo $name; ?>" placeholder="<?php echo $entry_name; ?>" id="input-name" class="form-control" />
              <?php if ($error_name) { ?>
              <div class="text-danger"><?php echo $error_name; ?></div>
              <?php } ?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-status"><?php echo $entry_status; ?></label>
            <div class="col-sm-10">
              <select name="status" id="input-status" class="form-control">
                <?php if ($status) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select>
            </div>
          </div>
               <ul class="nav nav-tabs">
            <li class="active"><a href="#tab-list1" data-toggle="tab"><?php echo $entry_list1; ?></a></li>
            <li><a href="#tab-list2" data-toggle="tab"><?php echo $entry_list2; ?></a></li>
            <li><a href="#tab-list3" data-toggle="tab"><?php echo $entry_list3; ?></a></li>
            <li><a href="#tab-list4" data-toggle="tab"><?php echo $entry_list4; ?></a></li>
          </ul> 
          <div class="tab-content">
          <!-- 选项一 -->
            <div class="tab-pane active" id="tab-list1">
             <div class="form-group">
            <label class="col-sm-1 control-label" for="input-name"><?php echo $entry_title; ?></label>
            <div class="col-sm-2">
              <input type="text" name="list1_title" value="<?php echo $list1_title; ?>" placeholder="<?php echo $entry_title; ?>" id="input-name" class="form-control" />
            </div>
            <label class="col-sm-1 control-label" for="input-name"><?php echo $entry_link; ?></label>
            <div class="col-sm-2">
              <input type="text" name="list1_link" value="<?php echo $list1_link; ?>" placeholder="<?php echo $entry_link; ?>" id="input-name" class="form-control" />
            </div>
            <label class="col-sm-1 control-label" for="input-name"><?php echo $entry_des; ?></label>
            <div class="col-sm-2">
              <input type="text" name="list1_des" value="<?php echo $list1_des; ?>" placeholder="<?php echo $entry_des; ?>" id="input-name" class="form-control" />
            </div>
            <label class="col-sm-1 control-label" for="input-name"><?php echo $entry_list1_bgcolor; ?></label>
            <div class="col-sm-2">
              <input type="text" name="list1_bgcolor" value="<?php echo $list1_bgcolor; ?>" placeholder="<?php echo $entry_list1_bgcolor; ?>" id="input-name" class="form-control" />
            </div>

          </div>
           <div class="form-group">
                     <div class="col-sm-10" align="center">
                           <label class="col-sm-2 control-label" for="input-name"><?php echo $entry_list1_bg; ?></label>
              <a href="" id="thumb-image100" data-toggle="image" class="img-thumbnail"><img src="<?php echo $list1_bg_thumb ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
                  <input type="hidden" name="list1_bg" value="<?php echo $list1_bg; ?>" id="input-image100;"/>
            </div>
           </div>
            <table id="frall" class="table table-striped table-bordered table-hover">
            <thead>
              <tr>
                <td class="text-left"><?php echo $entry_title; ?></td>
                <td class="text-left"><?php echo $entry_link; ?></td>
                <td></td>
              </tr>
            </thead>
            <tbody>
         <?php $rowcount1 = 0; ?>
              <?php foreach ($list1 as $onerow) { ?>
              <tr id="rowcount1<?php echo $rowcount1; ?>">
                <td class="text-right"><div class="input-group pull-left"><span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> </span>
                <input type="text" name="list1[<?php echo $rowcount1; ?>][title]" value="<?php echo $onerow['title']; ?>" placeholder="<?php echo $entry_title; ?>" class="form-control" />
                 </div>
                  <?php if (isset($error_name)) { ?>
                  <div class="text-danger"><?php echo $error_name; ?></div>
                  <?php } ?>
                </td>
                <td class="text-left"><input type="text" name="list1[<?php echo $rowcount1; ?>][link]" value="<?php echo $onerow['link']; ?>" placeholder="<?php echo $entry_link; ?>" class="form-control" /></td>
                <td class="text-right"><button type="button" onclick="$('#rowcount1<?php echo $rowcount1; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
              </tr>
              <?php $rowcount1++; ?>
              <?php } ?>
            </tbody>
            <tfoot>
              <tr>
                <td colspan="2"></td>
                <td class="text-right"><button type="button" onclick="addRow1();" data-toggle="tooltip" title="<?php echo $button_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
              </tr>
            </tfoot>
          </table>
            </div>
            <!-- 选项二 -->
<div class="tab-pane" id="tab-list2">
            <table id="frall" class="table table-striped table-bordered table-hover">
            <thead>
              <tr>
                <td class="text-left"><?php echo $entry_title; ?></td>
                <td class="text-left"><?php echo $entry_link; ?></td>
                <td class="text-left"><?php echo $entry_image; ?></td>
                <td class="text-left"><?php echo $entry_price; ?></td>
                <td></td>
              </tr>
            </thead>
            <tbody>
         <?php $rowcount2 = 0; ?>
              <?php foreach ($list2 as $onerow) { ?>
              <tr id="rowcount2<?php echo $rowcount2; ?>">
                <td class="text-right"><div class="input-group pull-left"><span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> </span>
                <input type="text" name="list2[<?php echo $rowcount2; ?>][title]" value="<?php echo $onerow['title']; ?>" placeholder="<?php echo $entry_title; ?>" class="form-control" />
                 </div>
                  <?php if (isset($error_name)) { ?>
                  <div class="text-danger"><?php echo $error_name; ?></div>
                  <?php } ?>
                </td>
                <td class="text-left"><input type="text" name="list2[<?php echo $rowcount2; ?>][link]" value="<?php echo $onerow['link']; ?>" placeholder="<?php echo $entry_link; ?>" class="form-control" /></td>
                <td class="text-left"><a href="" id="thumb-image<?php echo $rowcount2; ?>" data-toggle="image" class="img-thumbnail"><img src="<?php echo $onerow['thumb'] ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
                  <input type="hidden" name="list2[<?php echo $rowcount2;?>][image]" value="<?php echo $onerow['image']; ?>" id="input-image<?php echo $rowcount2; ?>"/></td>
                  <td class="text-left"><input type="hidden" name="list2[<?php echo $rowcount2;?>][price]" value="<?php echo $onerow['price']; ?>" id="input-image<?php echo $rowcount2; ?>"/></td>
                <td class="text-right"><button type="button" onclick="$('#rowcount2<?php echo $rowcount2; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
              </tr>
              <?php $rowcount2++; ?>
              <?php } ?>
            </tbody>
            <tfoot>
              <tr>
                <td colspan="4"></td>
                <td class="text-right"><button type="button" onclick="addRow2();" data-toggle="tooltip" title="<?php echo $button_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
              </tr>
            </tfoot>
          </table>
            </div>
            <!-- 选项三 -->
            <div class="tab-pane" id="tab-list3">
             <div class="form-group">
            <label class="col-sm-1 control-label" for="input-name"><?php echo $entry_title; ?></label>
            <div class="col-sm-5">
              <input type="text" name="list3_title" value="<?php echo $list3_title; ?>" placeholder="<?php echo $entry_title; ?>" id="input-name" class="form-control" />
            </div>
            <label class="col-sm-1 control-label" for="input-name"><?php echo $entry_link; ?></label>
            <div class="col-sm-5">
              <input type="text" name="list3_link" value="<?php echo $list3_link; ?>" placeholder="<?php echo $entry_link; ?>" id="input-name" class="form-control" />
            </div>
          </div>
             <table id="frall" class="table table-striped table-bordered table-hover">
            <thead>
              <tr>
                <td class="text-left"><?php echo $entry_title; ?></td>
                <td class="text-left"><?php echo $entry_link; ?></td>
                <td></td>
              </tr>
            </thead>
            <tbody>
         <?php $rowcount3 = 0; ?>
              <?php foreach ($list3 as $onerow) { ?>
              <tr id="rowcount3<?php echo $rowcount3; ?>">
                <td class="text-right"><div class="input-group pull-left"><span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> </span>
                <input type="text" name="list3[<?php echo $rowcount3; ?>][title]" value="<?php echo $onerow['title']; ?>" placeholder="<?php echo $entry_title; ?>" class="form-control" />
                 </div>
                  <?php if (isset($error_name)) { ?>
                  <div class="text-danger"><?php echo $error_name; ?></div>
                  <?php } ?>
                </td>
                <td class="text-left"><input type="text" name="list3[<?php echo $rowcount3; ?>][link]" value="<?php echo $onerow['link']; ?>" placeholder="<?php echo $entry_link; ?>" class="form-control" /></td>
                <td class="text-right"><button type="button" onclick="$('#rowcount3<?php echo $rowcount3; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
              </tr>
              <?php $rowcount3++; ?>
              <?php } ?>
            </tbody>
            <tfoot>
              <tr>
                <td colspan="2"></td>
                <td class="text-right"><button type="button" onclick="addRow3();" data-toggle="tooltip" title="<?php echo $button_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
              </tr>
            </tfoot>
          </table>
            </div>
            <!-- 选项四 -->
             <div class="tab-pane" id="tab-list4">
             <div class="form-group">
            <label class="col-sm-1 control-label" for="input-name"><?php echo $entry_title; ?></label>
            <div class="col-sm-5">
              <input type="text" name="list4_title" value="<?php echo $list4_title; ?>" placeholder="<?php echo $entry_title; ?>" id="input-name" class="form-control" />
            </div>
            <label class="col-sm-1 control-label" for="input-name"><?php echo $entry_des; ?></label>
            <div class="col-sm-5">
              <input type="text" name="list4_des" value="<?php echo $list4_des; ?>" placeholder="<?php echo $entry_des; ?>" id="input-name" class="form-control" />
            </div>
          </div>
            </div>
            </div>
          </table>
        </form>
      </div>
    </div>
  </div>
<script type="text/javascript">
var rowcount1= <?php echo $rowcount1;?>;
function addRow1() {
  html  = '<tr id="rowcount1' + rowcount1+ '">';
  html += '  <td class="text-left"><div class="input-group pull-left"><span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span><input type="text" name="list1[' + rowcount1+ '][title]" value="" placeholder="<?php echo $entry_title; ?>" class="form-control" /></div></td>';
  html += '  <td class="text-left"><input type="text" name="list1[' + rowcount1+ '][link]" value="" placeholder="<?php echo $entry_link; ?>" class="form-control" /></td>';
  html += '  <td class="text-right"><button type="button" onclick="$(\'#rowcount1' + rowcount1+ '\').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
  html += '</tr>';
  
  $('#tab-list1 tbody').append(html);
  rowcount1++;
}
var rowcount2= <?php echo $rowcount2;?>;
function addRow2() {
  html  = '<tr id="rowcount2' + rowcount2+ '">';
  html += '  <td class="text-left"><div class="input-group pull-left"><span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span><input type="text" name="list2[' + rowcount2+ '][title]" value="" placeholder="<?php echo $entry_title; ?>" class="form-control" /></div></td>';
  html += '  <td class="text-left"><input type="text" name="list2[' + rowcount2+ '][link]" value="" placeholder="<?php echo $entry_link; ?>" class="form-control" /></td>';
  html += '  <td class="text-left"><a href="" id="thumb-image'+rowcount2+'" data-toggle="image" class="img-thumbnail"><img src="<?php echo $placeholder; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a><input type="hidden" name="list2[' + rowcount2+ '][image]" value="" id="input-image' + rowcount2 + '"/></td>';
  html+='<td class="text-left"><input type="text" name="list2[' + rowcount2+ '][price]" value="" placeholder="<?php echo $entry_price; ?>" class="form-control" /></td>';
  html += '<td class="text-right"><button type="button" onclick="$(\'#rowcount2' + rowcount2+ '\').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
  html += '</tr>';
  
  $('#tab-list2 tbody').append(html);
  rowcount2++;
}
var rowcount3= <?php echo $rowcount3;?>;
function addRow3() {
  html  = '<tr id="rowcount3' + rowcount3+ '">';
  html += '  <td class="text-left"><div class="input-group pull-left"><span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span><input type="text" name="list3[' + rowcount3+ '][title]" value="" placeholder="<?php echo $entry_title; ?>" class="form-control" /></div></td>';
  html += '  <td class="text-left"><input type="text" name="list3[' + rowcount3+ '][link]" value="" placeholder="<?php echo $entry_link; ?>" class="form-control" /></td>';
  html += '  <td class="text-right"><button type="button" onclick="$(\'#rowcount3' + rowcount3+ '\').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
  html += '</tr>';
  
  $('#tab-list3 tbody').append(html);
  rowcount3++;
}
</script></div>
<?php echo $footer; ?>
